package com.xiongwei.iterator;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * @author XiongWei
 * @date 2024/2/20
 */
public class InfoCollege implements College {

    List<Department> departmentList;

    public InfoCollege() {
        departmentList = new ArrayList<>();
        departmentList.add(new Department("信息安全专业", "信息安全专业"));
        departmentList.add(new Department("网络安全专业", "网络安全专业"));
    }

    @Override
    public String getName() {
        return "信息学院";
    }

    @Override
    public void addDepartment(String name, String desc) {
        departmentList.add(new Department(name, desc));
    }

    @Override
    public Iterator createIterator() {
        return new InfoCollegeIterator(departmentList);
    }
}
